﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SRD.Model.SRD.Util;
using SRD.Classes;

namespace SRD.View.Autenticacao
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }

        protected void BtSalvar_Click(object sender, ImageClickEventArgs e)
        {
            Logar login = new Logar();
            Usuario usuario;
            usuario = login.getUsuario(txtLogin.Text, txtSenha.Text);
            
            if (usuario != null)
            {
                Session["usuario"] = usuario;
                Response.Redirect("../Views/Default.aspx");
            }
            else
            {
                MessageBox.Show("Usuário e ou Senha invalidos", MessageBox.MessageType.Success);
            }
        }


    }
}